Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

default capabilities cleanup #3484

Merged
merged 2 commits into from Nov 21, 2020

Conversation

antiochp
Copy link
Member

@antiochp antiochp commented Nov 5, 2020

We previously set node "capabilities" explicitly in the config file.
The capabilities are then advertised to peers via hand/shake protocol.

[server.p2p_config.capabilities]
bits = 15

This makes it hard to introduce new capabilities (for example PIBD support) as every node has these effectively hard-coded in their existing config files.
And every node needs to update the config to explicitly enable new capabilities.

This PR removes this configuration and simply defines "default" capabilities. This "default" can now change over time without explicit modification of the config file.


One (surprising and probably unexpected) thing we used node capabilities for was to express an "affinity" toward other peers. When requesting a peer address list we asked for peers that exhibited the same capabilities as our local node.
I don't think this ever makes sense, particularly in an environment where peers have heterogenous capabilities.
Nodes should advertise their local capabilities and it should be up to other nodes to decide, based on these capabilities, how to interact. A node wants to know about a wide range of other nodes, not just those that appear similar.

This PR modifies the "peer address list" logic to request lists of peers that themselves are also capable of providing lists of peers. No other capabilities are required. Previously we only asked for FULL_NODE (i.e. full set of capabilities) peers.


Introduce a new PIBD_HIST capabilities flag, currently unused and currently not included in default capabilities.


This PR should make it significantly easier to roll PIBD out across nodes incrementally. Only a subset of nodes may support PIBD initially.

We may want to introduce support for disabling some capabilities over time. This is outside the scope of this PR.

@antiochp antiochp marked this pull request as ready for review November 5, 2020 14:38
@antiochp antiochp added this to the 5.0.0 milestone Nov 5, 2020
@antiochp
Copy link
Member Author

Planning to enable the new PIBD_HIST capability in a separate PR as a final step once we are comfortable with #3470 and it is merged.

@phyro
Copy link
Member

phyro commented Nov 20, 2020

Out of curiosity, would a 'nimble node' also be a possible node capability value?

@antiochp
Copy link
Member Author

Out of curiosity, would a 'nimble node' also be a possible node capability value?

I'm imagining a "nimble" node as having a limited or reduced set of capabilities.
A nimble node may not support PIBD_HIST for example.

Copy link
Contributor

@jaspervdm jaspervdm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍 Ran it locally for a while without any issues

@antiochp antiochp merged commit b5c6d24 into mimblewimble:master Nov 21, 2020
@antiochp antiochp deleted the connect_capabilities branch November 21, 2020 21:49
@antiochp antiochp mentioned this pull request Nov 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants